<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.asaga.tools.*, java.util.*, java.io.*, java.net.*"%>
<%--
     Author:  Jeremy Sanderlin 
     Date Created: 2006-12-02
     Last Modified: 2006-12-03
     Last Modified By: Jeremy Sanderlin
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>

<% 
    String message = (String)session.getAttribute("message"); 
    if(message==null){
        message="no message";
    }
    String fname = "";
    String lname = "";
    String addr1 = "";
    String addr2 = "";
    String city = "";
    String state = "";
    String zip = "";
    String email = "";
    String phone = "";
    String cell = "";
    String dob = "";
    String classification = "";
    ClassificationList cl = new ClassificationList();
    ArrayList al = (ArrayList)cl.getClassification();
    
String username = (String)session.getAttribute("username");
SystemClient_DBImpl scdb = (SystemClient_DBImpl)session.getAttribute("userProfile");
session.setAttribute("userProfile",scdb);
if(username==null){
    response.sendRedirect("login.jsp?message=Please log in again.");
}
    if(scdb!=null){
        if(scdb.getFname()!=null){fname = scdb.getFname();}
        if(scdb.getLname()!=null){lname = scdb.getLname();}
        if(scdb.getAddr1()!=null){addr1 = scdb.getAddr1();}
        if(scdb.getAddr2()!=null){addr2 = scdb.getAddr2();}
        if(scdb.getCity()!=null){city = scdb.getCity();}
        if(scdb.getState()!=null){state = scdb.getState();}
        if(scdb.getZip()!=null){zip = scdb.getZip();}
        if(scdb.getEmail()!=null){email = scdb.getEmail();}
        if(scdb.getPhone()!=null){phone = scdb.getPhone();}
        if(scdb.getCell()!=null){cell = scdb.getCell();}
        if(scdb.getDob()!=null){dob = scdb.getDob();}
        if(scdb.getClassification()!=null){classification = scdb.getClassification();}
    }
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>ASAGA: My Profile</title>
        <style title="text/css">@import "style.css"; </style>
        <link rel="stylesheet" href="css/gray.css" type="text/css" title="gray">
        <link rel="stylesheet" href="css/autism.css" type="text/css" />
        <link rel="alternate stylesheet" type="text/css" href="css/red.css" title="red">
        <link rel="alternate stylesheet" type="text/css" href="css/blue.css" title="blue">
        <link rel="alternate stylesheet" type="text/css" href="css/orange.css" title="orange">
        <script type="text/javascript" src="javascript/styleswitcher.js"></script>
        <script type="text/javascript" src="javascript/DOMhelp.js"></script>
        <script type="text/javascript" src="javascript/styleChange.js"></script>
    </head>
    <body>
        <div class="main">
            <%@ include file="header.html" %>
            <div id="content">
                <h2>WELCOME, <%=username%>! (<a href="AutismSiteMasterController?action=logoff">Logout</a>)
                    <div id="colorchange">
                        <ul>
                            <li><a href="#" onclick="setActiveStyleSheet('gray'); return false;" title="Gray Theme"><img src="images/btngray.gif" alt="Gray Theme" /></a></li>
                            <li><a href="#" onclick="setActiveStyleSheet('red'); return false;" title="Red Theme"><img src="images/btnred.gif" alt="Red Theme" /></a></li>
                            <li><a href="#" onclick="setActiveStyleSheet('blue'); return false;" title="Blue Theme"><img src="images/btnblue.gif" alt="Blue Theme" /></a></li>
                            <li><a href="#" onclick="setActiveStyleSheet('orange'); return false;" title="Orange Theme"><img src="images/btnorange.gif" alt="Orange Theme" /></a></li>
                        </ul>
                    </div> <!-- div colorchange -->
                </h2>
                
                <form id="profile" action="AutismSiteMasterController" method="post">
                    <input type="hidden" id="action" name="action" value="updateprofile">
                    <h3>My Profile</h3>
                    <%=message%>
                    <h4>Who are you?</h4>
                    <div id="name">
                            <input type="text" name="fname" id="fname" value=<%=fname%> > First Name
                            <br/>
                            <input type="text" name="lname" id="lname" value=<%=lname%>> Last Name
                            <br/>
                            <input type="text" name="dob" id="dob" value=<%=dob%>> Date of Birth
                            <br/>
                            How does autism play a part in your life?
                            <br/>
                            <select name="classification" id="classification">
                                <option value="">
                                <% 
                                    for(int i=0;i<al.size();i++){ %>
                                        <option value=<%=(String)al.get(i)%> ><%=(String)al.get(i)%>
                                    <% }
                                %>
                            </select>
                            <br/>
                    </div>
                    <hr/>
                    <h4>Where do you live?</h4>
                    <div id="address">
                            <input type="text" name="addr1" id="addr1" value=<%=addr1%>> Address Line 1
                            <br/>
                            <input type="text" name="addr2" id="addr2" value=<%=addr2%>> Address Line 2
                            <br/>
                            <input type="text" name="city" id="city" value=<%=city%>> City
                            <br/>
                            <select name="state">
                            <option value=""></option>
                            <option value="AL">AL</option>
                            <option value="AK">AK</option>
                            <option value="AZ">AZ</option>
                            <option value="AR">AR</option>
                            <option value="CA">CA</option>
                            <option value="CO">CO</option>
                            <option value="CT">CT</option>
                            <option value="DE">DE</option>
                            <option value="DC">DC</option>
                            <option value="FL">FL</option>
                            <option value="GA">GA</option>
                            <option value="HI">HI</option>
                            <option value="ID">ID</option>
                            <option value="IL">IL</option>
                            <option value="IN">IN</option>
                            <option value="IA">IA</option>
                            <option value="KS">KS</option>
                            <option value="KY">KY</option>
                            <option value="LA">LA</option>
                            <option value="ME">ME</option>
                            <option value="MD">MD</option>
                            <option value="MA">MA</option>
                            <option value="MI">MI</option>
                            <option value="MN">MN</option>
                            <option value="MS">MS</option>
                            <option value="MO">MO</option>
                            <option value="MT">MT</option>
                            <option value="NE">NE</option>
                            <option value="NV">NV</option>
                            <option value="NH">NH</option>
                            <option value="NJ">NJ</option>
                            <option value="NM">NM</option>
                            <option value="NY">NY</option>
                            <option value="NC">NC</option>
                            <option value="ND">ND</option>
                            <option value="OH">OH</option>
                            <option value="OK">OK</option>
                            <option value="OR">OR</option>
                            <option value="PA">PA</option>
                            <option value="RI">RI</option>
                            <option value="SC">SC</option>
                            <option value="SD">SD</option>
                            <option value="TN">TN</option>
                            <option value="TX">TX</option>
                            <option value="UT">UT</option>
                            <option value="VT">VT</option>
                            <option value="VA">VA</option>
                            <option value="WA">WA</option>
                            <option value="WV">WV</option>
                            <option value="WY">WY</option>
                            </select>
                            <br/>
                            <input type="text" name="zip" id="zip" value=<%=zip%>> Zipcode
                            <br/>
                    </div>
                    <hr/>
                    <h4>How can you be contacted?</h4>
                    <div id="phone">
                            <input type="text" name="phone" id="phone" value=<%=phone%>> Home Phone
                            <br/>
                            <input type="text" name="cell" id="cell" value=<%=cell%>> Mobile Phone
                            <br/>
                            <hr/>
                    </div>
                    <input type="submit" name="submit" value="submit">
                </form>
            </div> <!-- div content -->
        </div> <!-- div main -->
        <%@ include file="footer.html" %>     
    </body>
</html>
<% 
    message="";
    session.setAttribute("message",message);

%>
